define(function(require, exports, module) {
	var $ = require('jquery');
	
	module.exports = TableManaged;
	
	function TableManaged() {
		return {
	        //main function to initiate the module
	        init: function () {
	            
	            if (!jQuery().dataTable) {
	                return;
	            }
	            
	            // begin first table
	            return $('#table-list').dataTable({
	            	"bPaginate" : false,
	            	"bFilter" : false,
	            	"bInfo" : false,
	                aoColumns : [
	                  { "bSortable": false },
	                  { "bSortable": false, "sClass" : "data-list-name"},
	                  {"sClass" : "data-list-oldPrice"},
	                  {"sClass" : "data-list-nowPrice"},
	                  {'sType' : 'input'},
	                  { "bSortable": false },
	                  { "bSortable": false }
	                ],
	                "aaSorting" : [[2, 'asc']],
	                "fnCreatedRow": function ( row, data, index ) {
	                	// 保存列表时根据这个class来获取数据
	                	$(row).addClass("data-list");
	                }
	            });
	        }
		}
	}
});